//
//  UIViewViewController+Extension.m
//  Pods
//
//  Created by txj on 2017/5/7.
//
//

#import "UIViewController+Extension.h"

@implementation UIViewController(Extension)
- (void)presentModelController:(UIViewController *)vc
{
    self.definesPresentationContext = YES; //self is presenting view controller
    vc.view.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:.4];
    vc.modalPresentationStyle = UIModalPresentationOverCurrentContext;
    [self presentViewController:vc animated:YES completion:nil];
}

- (void)removeModelViewController:(UIViewController *)childContorller
{
    [childContorller willMoveToParentViewController:self];
    [childContorller.view removeFromSuperview];
    [childContorller removeFromParentViewController];
}
@end
